{include file="../../templates/admin/header.tpl"}
<div class="span12">
	<div class="widget widget-table action-table">
		<div class="widget-header">
			<i class="icon-th-list"></i>
			<h3>Table list of Games</h3>
		</div>
		<!-- /widget-header -->
		<div class="widget-content">
			<table class="table table-striped table-bordered">
				<thead>
					<tr>
						<th>Popular</th>
						<th>Images</th>
						<th><i class="icon-large icon-play-circle"></i> Game name</th>
						<th><i class="icon-large icon-link"></i> Link</th>
						<th class="td-actions"><div id="load" align="center"><img src="/static/img/loading-small.gif" width="16" height="11" /> Loading...</div></th>
					</tr>
				</thead>
				<tbody>
				{foreach $games as $key=>$value}
					<tr class="warning">
						<td rowspan="2" class="td-actions">
						{if $value['popular'] == 0}
							<a href="1" id="popular-{$value['g_id']}" data-id="{$value['g_id']}" data-type="games" class="popular" title="Switch to popular status"><i class="icon-large icon-star-empty"></i></a>
						{else}
							<a href="0" id="popular-{$value['g_id']}" data-id="{$value['g_id']}" data-type="games" class="popular" title="Switch to normal status"><i class="icon-large icon-star"></i></a>
						{/if}
						</td>
						<td rowspan="2" class="td-actions"><a href="{$value['crawl_url']}" target="_blank">{$value['images']}</a></td>
						<td{if $value['active'] == 0} style="background:yellow;"{/if}>
							<h3>
								{if $value['active'] == 0}
									<a href="1" id="active-{$value['g_id']}" data-id="{$value['g_id']}" data-type="games" class="active" title="Switch to enable status"><i class="icon-large icon-remove"></i></a>
								{else}
									<a href="0" id="active-{$value['g_id']}" data-id="{$value['g_id']}" data-type="games" class="active" title="Switch to disable status"><i class="icon-large icon-ok"></i></a>
								{/if}
								 {$value['g_name']}
							</h3>
						</td>
						<td><a href="{$control_play}{$value['g_url']}.html" title="Test {$value['g_name']} game" target="_blank"><i class="icon-small icon-external-link"></i> {$value['g_url']}</a></td>
						<td rowspan="2" class="td-actions">
							<a href="/admin/?mod=games&act=edit&id={$value['g_id']}" class="btn btn-small btn-success"><i class="btn-icon-only icon-pencil"></i></a>
							<a data-id="{$value['g_id']}" class="btn btn-danger btn-small gdelete"><i class="btn-icon-only icon-remove"></i></a>
						</td>
					</tr>
					<tr>
						<td title="Category"><i class="icon-small icon-check"></i> {$value['category']}</td>
						<td title="Tags"><i class="icon-small icon-tag"></i> {$value['tags']}</td>
					</tr>
				{/foreach}
				</tbody>
				{if isset($panigation)}
				<tfoot>
					<tr>
						<td colspan="5" class="td-actions pagination-centered">{$panigation}</td>
					</tr>
				</tfoot>
				{/if}
			</table>
		</div>
		<!-- /widget-content --> 
	</div>
</div>
{include file="../../templates/admin/footer.tpl"}